home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 April: Mac OS SDK / Dev.CD Apr 00 SDK1.toast / Development Kits / Mac OS / Apple Remote Access API / Remote Access 2.0 API / standard.h < prev   
Encoding:
C/C++ Source or Header  |  1993-11-04  |  2.2 KB  |  84 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        standard.h
  3.  
  4.     Contains:    Standard definitions.
  5.  
  6.     Copyright:    © 1991-1994 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. /* ********************************************************************* */
  11. /* *                                                                   * */
  12. /* *                      "MPW C" Version                              * */
  13. /* *                                                                   * */
  14. /* ********************************************************************* */
  15.  
  16. #ifndef    _standard_h_
  17.  
  18.  
  19. /* ********************************************************************* */
  20. /* *                                                                   * */
  21. /* *    The definitions that follow are what is considered to be the   * */
  22. /* *    standard UNIX definitions.                                     * */
  23. /* *                                                                   * */
  24. /* ********************************************************************* */
  25.  
  26.  
  27. /*
  28. **    Abbreviated type Definitions
  29. */
  30.  
  31. typedef        unsigned char        uchar;
  32. typedef        unsigned char        *uPtr;
  33. typedef        unsigned short        ushort;
  34. typedef        unsigned int        uint;
  35. typedef        unsigned long        ulong;
  36.  
  37. /*
  38. **    Standard Type Definitions
  39. */
  40.  
  41. typedef        unsigned char         u_int_08;
  42. typedef        unsigned int         u_int_16;
  43. typedef        unsigned long int     u_int_32;
  44.  
  45. typedef        char                 s_int_08;
  46. typedef        int                    s_int_16;
  47. typedef        long int             s_int_32;
  48.  
  49.  
  50. /*
  51. **    Convenient Coding Macros    
  52. */
  53.  
  54. #define        forever            for(;;)
  55.  
  56. #define     iter(i,max)        for(i=0;i<max,i++)
  57.  
  58. #define        repeat            do
  59. #define        until(x)        while(!(x))
  60.  
  61. #define        ifnot(x)        if(!(x))
  62.  
  63. #define        max(a,b)        (((a)>(b))?(a):(b))    /* caution - side effects    */
  64. #define        min(a,b)        (((a)<(b))?(a):(b))    /* caution - side effects    */
  65.  
  66. #define        uppercase(x)    ((((x)>='a')&((x)<='z'))?((x)+'A'-'a'):(x))
  67. #define        lowercase(x)    ((((x)>='A')&((x)<='Z'))?((x)+'a'-'A'):(x))
  68.  
  69. /*  Returns number of elements in an array                                    */
  70.  
  71. #define        countof(a)        (sizeof(a)/sizeof((a)[0]))
  72.  
  73. /*  Returns a pointer to the first element in an array                          */
  74.  
  75. #define        startp(a)        (&(a)[0])
  76.  
  77. /*  Returns a pointer to the last element in an array                         */
  78.  
  79. #define        endp(a)            (&(a)[(sizeof(a)/sizeof((a)[0]))-1])
  80.  
  81.  
  82. #define    _standard_h_
  83. #endif    _standard_h_
  84.